<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <h1>登录</h1>
    <input type="text" id="username">
    <input type="text" id="password">
    <input type="button" value="登录" id="loginBtn">

    <script src="./js/jquery.min.js"></script>

    <script>
        $("#loginBtn").click(function () {
            const username = $("#username").val();
            const password = $("#password").val();

            $.ajax({
                url: '/users/login',
                type: 'post',
                data: { username, password},
                success(msg) {
                    if(msg){
                        alert("登录成功！")
                    }else{
                        alert("登录失败！")
                    }
                }
            })
        })
    </script>
</body>

</html>